package dnablockfinder;

import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class EvoLeaf extends EvoNode {
	private String name;
	private String strand;

	@Override
	protected int parseInternal(String parseString, int index,
			char endTag, Map<String,String> sequences) {
		int eoo = parseString.indexOf(':', index);
		name = parseString.substring(index, eoo);
		strand = sequences.get(name);
		return eoo;
	}

	@Override
	public Analysis[] analyze(int filterRadius) {
		Analysis[] retData = new Analysis[strand.length()];
		for (int i = 0; i < retData.length; i ++)
			retData[i] = new Analysis(strand.charAt(i));
		return retData;
	}

	@Override
	public String print(Path path) throws IOException { return name; }
}
